home *** CD-ROM | disk | FTP | other *** search
/ Champak 138 / Volume 138 Aug 19 2011 - Damaged.iso / Games / shadez.swf / scripts / Local / Game / Thing / CWeaponM16.as < prev   
Encoding:
Text File  |  2011-08-19  |  3.1 KB  |  122 lines

  1.  
  2. {
  3.    if(true)
  4.    {
  5.       CWeaponM16 = ┬º┬ºnewclass(CWeaponM16,CWeapon);
  6.    }
  7. }
  8.  
  9. package Local.Game.Thing
  10. {
  11.    import Local.Game.World.*;
  12.    import Local.Game.World.Map.*;
  13.    import Local.Game.World.Map.Cell.*;
  14.    import Local.Math.*;
  15.    import STC9.System.*;
  16.    import flash.display.*;
  17.    import flash.events.*;
  18.    import flash.geom.*;
  19.    
  20.    public class CWeaponM16 extends CWeapon
  21.    {
  22.       
  23.       public static var _Upgrades:Array = [{
  24.          "mName":"",
  25.          "mAmmo":INFINATEAMMO,
  26.          "mAutoFire":true,
  27.          "mFireRate":SECONDS / 2,
  28.          "mDamage":10,
  29.          "mRange":INFINATERANGE
  30.       }];
  31.        
  32.       
  33.       public function CWeaponM16()
  34.       {
  35.          if(true)
  36.          {
  37.             super();
  38.             if(true)
  39.             {
  40.                mAngleRange = {
  41.                   "min":-80,
  42.                   "max":80
  43.                };
  44.                if(true)
  45.                {
  46.                   mUpgrade = 0;
  47.                   if(true)
  48.                   {
  49.                      mType = "gunm16";
  50.                      if(true)
  51.                      {
  52.                         Process = Process_Normal;
  53.                      }
  54.                      mAccuracy = 1;
  55.                   }
  56.                   AddSound("fire_0",Gun_Fire_1);
  57.                }
  58.                AddSound("fire_1",Gun_Fire_2);
  59.             }
  60.             AddSound("fire_2",Gun_Fire_3);
  61.          }
  62.       }
  63.       
  64.       override public function Fire() : void
  65.       {
  66.          var _loc1_:CShot = null;
  67.          if(true)
  68.          {
  69.             super.Fire();
  70.          }
  71.          AddThing(_loc1_ = new CShotBullet(GetShotPosition(),GetShotDelta(),47 + Math.random() * 6,mParent.mCurrentTarget));
  72.          if(mParent.mDrawn)
  73.          {
  74.             AddThing(new CEffectMuzzleFlash(MuzzleFlash_M16,_loc1_.mPosition.Clone(),_loc1_.mDelta));
  75.          }
  76.          PlaySound("fire_" + Math.floor(Math.random() * 3),_loc1_.mPosition);
  77.          IncrementFired();
  78.       }
  79.       
  80.       public function GetShotDelta() : CPosition
  81.       {
  82.          return mParent.GetShotDelta("m16_wp1");
  83.       }
  84.       
  85.       public function GetShotPosition() : CPosition
  86.       {
  87.          return mParent.GetShotPosition("m16_wp1");
  88.       }
  89.       
  90.       override public function get mWeaponName() : String
  91.       {
  92.          return "gunm16";
  93.       }
  94.       
  95.       override public function Draw() : void
  96.       {
  97.          var _loc1_:Point = null;
  98.          var _loc2_:Point = null;
  99.          super.Draw();
  100.          mPosition.Copy(GetShotPosition());
  101.          _loc1_ = GetShotDelta();
  102.          _loc2_ = GetDrawPosition();
  103.          bPlane.fillRect(new Rectangle(_loc2_.x,_loc2_.y,1,1),4294901760);
  104.          bPlane.fillRect(new Rectangle(_loc2_.x + _loc1_.x * 2,_loc2_.y + _loc1_.y * 2,1,1),4278190335);
  105.       }
  106.       
  107.       public function Process_Normal() : void
  108.       {
  109.          if(true)
  110.          {
  111.             WeaponUpdate();
  112.             Process_Children();
  113.          }
  114.       }
  115.       
  116.       override public function get mUpgrades() : Array
  117.       {
  118.          return _Upgrades;
  119.       }
  120.    }
  121. }
  122.